<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
.container {
    display: flex;
    height: 100px; /* 为了演示方便设置的高度 */
    background-color: grey; /* body的背景颜色 */
    /* transition: background-color 0.5s ease; 背景颜色变化的过渡效果 */
}

.eleA {
    width: 200px;
    background-color: blue;
    /* transition: width 0.3s ease; 宽度变化的过渡效果 */
}

.eleB {
    flex: 1;
    background-color: green;
    /* transition: flex 0.3s ease; flex属性变化的过渡效果 */
}

  </style>
</head>

<body>
  <div class="container">
    <div class="eleA"></div>
    <div class="eleB"></div>
</div>
<button id="btn">点击按钮</button>
<button id="btn2">点击按钮2</button>
<img  alt="">


</body>
<script>
const btn = document.getElementById('btn');
const btn2 = document.getElementById('btn2');
const eleA = document.querySelector('.eleA');

btn.addEventListener('click', function() {
    eleA.style.width = '64px';
});
btn2.addEventListener('click', function() {
    eleA.style.width = '200px';
});
document.querySelector('img').src='http://ego-ffs.klnee.xyz/image/202407/357b2a54474a46dda53a95c735d8ccf9.jpg'


</script>

</html>